//
//  VisitorViewController.swift
//  myWeibo
//
//  Created by MrWu on 16/4/7.
//  Copyright © 2016年 MrWu. All rights reserved.
//

import UIKit

class VisitorViewController: UITableViewController {

    var visitorView: VisitorView?
    /// 控制是否登录
    private var userLogin = false
    
    override func loadView() {
        userLogin ? super.loadView() :setupVisitorView()
    }
    
    func setupVisitorView() {
        visitorView = VisitorView()
        visitorView?.delegate = self;
        view = visitorView
    }
}

extension VisitorViewController: visitorViewDelegate {
     func registerButtonClick() {
        print("注册按钮")
    }
    
    func loginButtonClick() {
        print("登录按钮")
        let nav = UINavigationController(rootViewController: OAuthViewController())
        presentViewController(nav, animated: true, completion: nil)
    }
}